/**
 * 
 */
package com.feib.stms.model;

import java.util.Date;

/**
 * @author Jimmy Liu
 *
 */
public class UserLoginControl extends BaseEntity {
	
	private static final long serialVersionUID = -761603279209712286L;
	
	/**
     * PK in Table
     */
    private Long userLoginControlPk;
    
    /**
     * 登入帳號
     */
    private User user;

    /**
     * 登入Session ID
     */
    private String sessionId;

    /**
     * 最近一次登入時間
     */
    private Date loginTime;

    /**
     * 登入位址
     */
    private String loginLocaleIP;

    /**
     * 是否啟用 <li>true: 啟用</li> <li>false: 停用</li>
     */
    private Boolean actived;
    
    /**
     * 最近異動時間
     */
    private Date activityTime;

	/**
	 * @return actived
	 */
	public Boolean getActived() {
		return actived;
	}

	/**
	 * @param actived 的設定的 actived
	 */
	public void setActived(Boolean actived) {
		this.actived = actived;
	}

	/**
	 * @return activityTime
	 */
	public Date getActivityTime() {
		return activityTime;
	}

	/**
	 * @param activityTime 的設定的 activityTime
	 */
	public void setActivityTime(Date activityTime) {
		this.activityTime = activityTime;
	}

	/**
	 * @return loginLocaleIP
	 */
	public String getLoginLocaleIP() {
		return loginLocaleIP;
	}

	/**
	 * @param loginLocaleIP 的設定的 loginLocaleIP
	 */
	public void setLoginLocaleIP(String loginLocaleIP) {
		this.loginLocaleIP = loginLocaleIP;
	}

	/**
	 * @return loginTime
	 */
	public Date getLoginTime() {
		return loginTime;
	}

	/**
	 * @param loginTime 的設定的 loginTime
	 */
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	/**
	 * @return sessionId
	 */
	public String getSessionId() {
		return sessionId;
	}

	/**
	 * @param sessionId 的設定的 sessionId
	 */
	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	/**
	 * @return user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @param user 的設定的 user
	 */
	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * @return userLoginControlPk
	 */
	public Long getUserLoginControlPk() {
		return userLoginControlPk;
	}

	/**
	 * @param userLoginControlPk 的設定的 userLoginControlPk
	 */
	public void setUserLoginControlPk(Long userLoginControlPk) {
		this.userLoginControlPk = userLoginControlPk;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("UserLoginControl [userLoginControlPk=");
		builder.append(userLoginControlPk);
		
		if (null != user)
		{
			builder.append(", user.userPk=");
			builder.append(user.getUserPk());
			
			builder.append(", user.userId=");
			builder.append(user.getUserId());
			
			if (null != user.getGroup())
			{
				builder.append(", user.group.groupNo=");
				builder.append(user.getGroup().getGroupNo());
			}
		}
		builder.append(", sessionId=");
		builder.append(sessionId);
		builder.append(", loginTime=");
		builder.append(loginTime);
		builder.append(", loginLocaleIP=");
		builder.append(loginLocaleIP);
		builder.append(", actived=");
		builder.append(actived);
		builder.append(", activityTime=");
		builder.append(activityTime);
		builder.append("]");
		return builder.toString();
	}

}
